<!DOCTYPE html>
<html>

<head>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
    <title></title>
    <style>
        p {
            color: red;
            margin: 4px;
        }

        b {
            color: blue;
        }
    </style>
    <script src="../../libs/jquery-1.11.3.js"></script>
</head>

<body>
<h3 id="123" class="aa bb">.val()</h3>

<select id="single">
    <option>慕课网</option>
    <option>博客园</option>
</select>
<select id="multiple" multiple="multiple">
    <option selected="selected">imocc</option>
    <option>慕课网</option>
    <option selected="selected">博客园</option>
</select>
<input type="text" value="click a button"/>
<p></p>

<script type="text/javascript">
    //单个select，返回第一个
    $("p").text($("#single").val())
</script>

<script type="text/javascript">
    //多个select被选择，返回["imocc", "博客园"]
    $("p").text($("#multiple").val())
</script>


<script type="text/javascript">
    //选择一个表单，修改value的值
    $("input").val('修改表单的字段')
</script>
<script>
    //    var ele = document.getElementsById("123");
    var ele2 = document.getElementsByClassName("aa");
    for (var i = 0; i < ele2.length; i++) {
        ele2[i].innerHTML = "haha";
    }
    //    $(ele2).html("123");
    //    $(".2").html("123");

</script>


</body>

</html>